package com.dao;

import java.util.List;

import org.hibernate.Query;
import org.hibernate.Session;

import com.base.dao.AbsTaskBaseDao;
import com.bean.Userextendinfo;

public class UserExtendInfoDao extends AbsTaskBaseDao<Integer, Userextendinfo> {
	
	public List<Object> query (String hql, int from, int count){
		if(hql == null || hql.trim().length() == 0){
			return null;
		}
		Session session = null;
		try {
			session = this.getSession();
			Query query1 =session.createSQLQuery(hql);
			
			query1.setFirstResult(from);
			query1.setMaxResults(count);
			List li = query1.list();
			
//			Query query = session.createQuery(hql);
//			if (count >= 0) {
//				query.setFirstResult(from);
//				query.setMaxResults(count);
//			}
			return query1.list();
		} catch (Exception e) {
			e.printStackTrace();
		} finally {
			this.releaseSession(session);
		}
		return null;
	}

}
